{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#将图片内嵌在交互窗口，而不是弹出一个图片窗口\n",
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "\n",
    "x = np.arange(20)\n",
    "y = x**2\n",
    "\n",
    "plt.plot(x,  y)\n",
    "#下面行不写会出现 [<matplotlib.lines.Line2D at 0x111814390>] 字样\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from matplotlib import pyplot as plt\n",
    "from mpl_toolkits.mplot3d import Axes3D\n",
    "\n",
    "# 定义坐标轴\n",
    "fig4 = plt.figure()\n",
    "ax4 = plt.axes(projection=\"3d\")\n",
    "\n",
    "# 生成三维数据\n",
    "xx = np.arange(-5, 5, 0.1)\n",
    "yy = np.arange(-5, 5, 0.1)\n",
    "X, Y = np.meshgrid(xx, yy)\n",
    "Z = np.sin(np.sqrt(X**2 + Y**2))\n",
    "\n",
    "# 作图\n",
    "ax4.plot_surface(X, Y, Z, alpha=0.3, cmap=\"winter\")  # 生成表面， alpha 用于控制透明度\n",
    "ax4.contour(X, Y, Z, zdir=\"z\", offset=-3, cmap=\"rainbow\")  # 生成z方向投影，投到x-y平面\n",
    "ax4.contour(X, Y, Z, zdir=\"x\", offset=-6, cmap=\"rainbow\")  # 生成x方向投影，投到y-z平面\n",
    "ax4.contour(X, Y, Z, zdir=\"y\", offset=6, cmap=\"rainbow\")  # 生成y方向投影，投到x-z平面\n",
    "# ax4.contourf(X,Y,Z,zdir='y', offset=6,cmap=\"rainbow\")   #生成y方向投影填充，投到x-z平面，contourf()函数\n",
    "\n",
    "# 设定显示范围\n",
    "ax4.set_xlabel(\"X\")\n",
    "ax4.set_xlim(-6, 4)  # 拉开坐标轴范围显示投影\n",
    "ax4.set_ylabel(\"Y\")\n",
    "ax4.set_ylim(-4, 6)\n",
    "ax4.set_zlabel(\"Z\")\n",
    "ax4.set_zlim(-3, 3)\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjwAAAHACAYAAACmt7JlAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8fJSN1AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAyG0lEQVR4nO3de3SU1b3G8WcgYRJDMgNaCJhIEkNpFdJYLq3QVtSAVIlFT6xTtBREi2SVkyBiMxSq9XJASjFLqx5yGtF6wbul4IViMUSsEIKCUMWgJCEpEZIQZxJMhlzm/MFy2hhCZmDCJNvvZ613LWe/+93zm6zlmof33XuPxev1egUAAGCwPqEuAAAAoLsReAAAgPEIPAAAwHgEHgAAYDwCDwAAMB6BBwAAGI/AAwAAjEfgAQAAxiPwAAAA4xF4AATFhx9+qIULF6qqqqrDudzcXI0bN04ul8vv8Q4cOHDKtRw+fLjTMdlcHvh6IvAACIqdO3cqLy9PAwcObNfe2Nio5cuX6/Dhw1qyZIlfY/3xj3/UiBEjtGbNmlOqZdy4ccrJyenQPn36dF199dWnNCaA3o3AA+C0HDt2TG+88YYKCws1fPhwbd26VW+88Ybv/J133qmLLrpIxcXFWrt2rZYsWdLlXZYbbrhB11xzjW644Qb93//9X0D1NDQ06MCBA0pLS2vX7na7VVRUpOuvvz6g8U6koKBAFovltMbYuHGjzj///NOuBYB/wkJdAIDe7ejRo7rttttUUVEhu92uX/3qVzp27Jg+/vhjbdmyRS+88IKKiop0zjnnaN26dbrkkku0a9cuPfLII4qLizvhmAMGDNDTTz+ts846S7feeqvOP/98XXbZZSeto6WlRZ999pl27dqlyMhIJScnq7KyUv369dOgQYP03HPPqbW1VR6PR0899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mKiIjQiBEj9Mc//lE//vGPZbfblZOTo+Tk5HbXfHWZur9efvllbdiwQb///e/15ptvaseOHb55PS0tLZo7d65++9vf6tprrz2l8QH4h0daAM6IyMhI/fnPf1b//v1VV1enmJiYk/bPz8/XyJEjfUdubm6HPmvXrtWAAQOUmZkZUC3Lli3ToUOHtGDBAl/b8OHD1djYqA8++ED9+/f3PaILhpKSEh05ckSXXXaZZsyYoRkzZkg6/thrxowZeuedd3TjjTcG7f0AdETgARA0LS0tHebwtLS0tOvT1NSkbdu2afjw4e3aW1tb1dLS4vuphtmzZ2vPnj2+Izs7W9LxpeOnsxfPo48+qnvvvVfPPPOMpOM/g5GRkaEpU6Zo2bJl2rlzp9asWaPExETNnz9fb7/9dofP2NbW1q6tqqpK77//vg4ePHjCidXz5s3Thg0b1NbWpm9961t69tln9fTTT+v111/X6tWr9f3vf18zZ85kx2WgG/FIC0BACgoKfP/9ZfD4csXRypUrlZWVpR/+8IeSpPvvv18DBw6UJDU2NiotLU39+/fX9OnTdemll7Ybt7GxUUePHtWwYcN8m+89++yz7fp4vV7l5eVpz549GjhwoDIyMvTggw/6dk32R2pqqtasWaPzzjtPSUlJSk1N1XXXXac///nPvsdihYWF+stf/qIHH3xQHo/H93mk44GtsbGxQ12TJ0/WRRddpLFjx7Y79/bbb+vxxx/XO++8I6fTqV/84hcqKyvT7bffrt27d2vdunVKTk7WVVddpdTUVL355ptMXga6gcXLT/8C6KU+//xzTZo0SWvXrtXQoUMDvr65ubnLjQy9Xu9pTSb+6KOPtHPnTl177bW+lWkNDQ1as2aNZsyY4WtrbW3Vxo0b/d7BGUBgCDwAerXW1lb17ds31GUA6OEIPAAAwHhMWgYAAMYj8AAAAOMReAAAgPEIPAAAwHgEHgAAYDwCDwAAMB6BBwAAGI/AAwAAjPf/0xw6oMAiZgEAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import re\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "l = int(input(\"请输入你想绘制的行数:l=\"))\n",
    "\n",
    "date = []\n",
    "\n",
    "# todo 关键读取文件\n",
    "with open(\"刘维康.txt\", \"r\", encoding=\"utf-8\") as f:\n",
    "    for line in f:\n",
    "        try:\n",
    "            get_l = int(line[:3])\n",
    "        except:\n",
    "            get_l = -1\n",
    "\n",
    "        if get_l == l:\n",
    "            date.append(line.strip())\n",
    "\n",
    "show_x = []\n",
    "show_y = []\n",
    "\n",
    "# todo 注意len（date）不用减1\n",
    "for i in range(0, len(date)):\n",
    "    d_line = re.split(r\"\\s+\", date[i])\n",
    "    show_x.append(float(d_line[1]))\n",
    "    show_y.append(float(d_line[2]))\n",
    "\n",
    "# todo 解决中文显示问题\n",
    "plt.rcParams[\"font.sans-serif\"] = [\"SimHei\"]\n",
    "\n",
    "plt.title(f\"输入的 l={l}\")\n",
    "plt.xlabel(\"m的值，及行数\")\n",
    "plt.ylabel(\"P[l][m]\")\n",
    "\n",
    "# todo 设置x轴刻度显示\n",
    "plt.xticks(show_x, rotation=-90)\n",
    "plt.scatter(show_x, show_y)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0.0,\n",
       " 1.0,\n",
       " 2.0,\n",
       " 3.0,\n",
       " 4.0,\n",
       " 5.0,\n",
       " 6.0,\n",
       " 7.0,\n",
       " 8.0,\n",
       " 9.0,\n",
       " 10.0,\n",
       " 11.0,\n",
       " 12.0,\n",
       " 13.0,\n",
       " 14.0,\n",
       " 15.0,\n",
       " 16.0,\n",
       " 17.0,\n",
       " 18.0,\n",
       " 19.0,\n",
       " 20.0,\n",
       " 21.0,\n",
       " 22.0,\n",
       " 23.0,\n",
       " 24.0,\n",
       " 25.0,\n",
       " 26.0,\n",
       " 27.0,\n",
       " 28.0,\n",
       " 29.0]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "show_x"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
